package fr.zadoka.zadokadna.db;

import android.net.Uri;
import android.provider.BaseColumns;

/**
 * 
 * Zadoka Database contract
 *
 */
public final class ZadokaDatabaseContract {
	/**
	 * Zadoka DB Version
	 */
    public static final int DATABASE_VERSION = 6;
    
    /**
     * Zadoka DB Name
     */
    public static final String DATABASE_NAME = "ZadokaDna";
    
    // The URI scheme used for content URIs
    public static final String SCHEME = "content";

    // The provider's authority
    public static final String AUTHORITY = "fr.zadoka.zadokadna.favorite.provider";
    
    /**
     * The DataProvider content URI
     */
    public static final Uri CONTENT_URI = Uri.parse(SCHEME + "://" + AUTHORITY);    
    
    /**
     *  The MIME type for a content URI that would return multiple rows
     *  <P>Type: TEXT</P>
     */
    public static final String MIME_TYPE_ROWS =
            "vnd.android.cursor.dir/vnd.fr.zadoka.zadokadna.zadoka";    
    
    /**
     * The MIME type for a content URI that would return a single row
     *  <P>Type: TEXT</P>
     *
     */
    public static final String MIME_TYPE_SINGLE_ROW =
            "vnd.android.cursor.item/vnd.fr.zadoka.zadokadna.zadoka";    
    
    
    //favorite table contract
    public static abstract class ZadokaFavoriteContract implements BaseColumns
    {
    	/**
         * Picture table primary key column name
         */
        public static final String ROW_ID = BaseColumns._ID;

        /**
         * Table name
         */
    	public static final String ZADOKA_DNA_TABLE_NAME = "zadoka";
    	
    	//favorite table columns
    	public static final String ZADOKA_DNA_IMAGE_DATE = "image_date";
    	public static final String ZADOKA_DNA_IMAGE_LINK = "image_link";
    	public static final String ZADOKA_DNA_IS_FAVORITE = "is_favorite";   
    	
    	/**
         * favorite table content URI
         */
        public static final Uri FAVORITE_TABLE_CONTENTURI =
                Uri.withAppendedPath(CONTENT_URI, ZADOKA_DNA_TABLE_NAME);
        
        /**
         * < V6 primary key
         */
    	public static final String ZADOKA_DNA_IMAGE_ID = "image_id";
                
    }
    

    //old favorite table 
    public static abstract class ZadokaFavorites
    {
    	public static final String FAVORITE_TABLE_NAME = "favorite";
    	
    	public static final String FAVORITE_IMAGE_ID = "image_id";
    	public static final String FAVORITE_IMAGE_DATE = "image_date";
    	public static final String FAVORITE_IMAGE_LINK = "image_link";
    }
}
